# 1.导包
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
import random
# 2.打开浏览器（创建浏览器驱动对象）
path = r"C:\Program Files\Python311\chromedriver.exe"
ser = Service(executable_path=path)  # Chrome浏览器驱动服务对象
driver = webdriver.Chrome(service=ser)  # 打开Chrome浏览器
# 3.输入网址
driver.get("http://121.43.169.97:8081/")
# 4.页面操作
driver.find_element(By.CLASS_NAME, value='reg').click()
driver.find_element(By.ID, value='phone').send_keys('15532542150')
driver.find_element(By.ID, value='password').send_keys('1q2w3e')
driver.find_element(By.ID, value='verifycode').send_keys('8888')
driver.find_element(By.ID, value='get_phone_code').click()
time.sleep(3)
driver.find_element(By.ID, value='phone_code').send_keys('666666')
driver.find_element(By.CLASS_NAME, value='lg-btn').click()
time.sleep(2)
driver.find_element(By.LINK_TEXT, '暂不开通托管账号，随便逛逛').click()
# time.sleep(2)
# driver.find_element(By.NAME,'realname').send_keys('梁雪吻')
# driver.find_element(By.NAME,'card_id').send_keys('140622200122273215')
# driver.find_element(By.CSS_SELECTOR,'[value="确认提交"]').click()
# driver.find_element(By.CSS_SELECTOR,'[value="立即开通"]').click()
# 5.等待2秒
time.sleep(2)
# 6.退出浏览器
driver.quit()
